package cn.liberals.controller;

import cn.liberals.domain.Store;
import cn.liberals.service.IStoreService;
import cn.liberals.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StoreController {

    @Autowired
    private IStoreService storeService;

    /* 
    * @Title: add
    * @Description: 新增库存接口
    * @Author: liberals
    * @Version: 1.0
    * @Date:  2022/7/30 10:48
    * @Parameters: 
    * @Return 
    */
    @PostMapping("/store/add")
    public AjaxResult add(@RequestBody Store store){
        try {
            storeService.add(store);
            return new AjaxResult();
        } catch (Exception e) {
            e.printStackTrace();
            return new AjaxResult(false, "系统异常");
        }

    }

}
